using System;
using Castle.ActiveRecord;
using WineCellar.Data;

namespace WineCellar.Data
{
	[ActiveRecord("Cellar2Wines", Schema = "dbo", UseAutoImport = false)]
    public partial class CellarWine
    {         
        private string tastingNotes;
        private Nullable<int> quantity;
        private Nullable<int> price;
        private Nullable<int> vintage;
        private Nullable<DateTime> dateAdded;        
        private Nullable<int> id;        
        private Wine wine;
        private User addedBy;
        private Cellar cellar;        

        [Property("TastingNotes", ColumnType = "StringClob")]
		public virtual string TastingNotes
        {
            get
            {
                return this.tastingNotes;
            }
            set
            {
                this.tastingNotes = value;
            }
        }

        [Property("Quantity", ColumnType = "Int32")]
		public virtual Nullable<int> Quantity
        {
            get
            {
                return this.quantity;
            }
            set
            {
                this.quantity = value;
            }
        }

        [Property("Price", ColumnType = "Int32")]
		public virtual Nullable<int> Price
        {
            get
            {
                return this.price;
            }
            set
            {
                this.price = value;
            }
        }

        [Property("Vintage", ColumnType = "Int32")]
		public virtual Nullable<int> Vintage
        {
            get
            {
                return this.vintage;
            }
            set
            {
                this.vintage = value;
            }
        }

        [Property("DateAdded", ColumnType = "Timestamp")]
		public virtual Nullable<DateTime> DateAdded
        {
            get
            {
                return this.dateAdded;
            }
            set
            {
                this.dateAdded = value;
            }
        }

        [PrimaryKey(PrimaryKeyType.Identity)]
		public virtual Nullable<int> Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        [BelongsTo("WineId",NotNull = true)]
        public virtual Wine Wine
        {
            get
            {
                return this.wine;
            }
            set
            {
                this.wine = value;
            }
        }

        [BelongsTo("UserAdded",NotNull = true)]
        public virtual User AddedBy
        {
            get
            {
                return this.addedBy;
            }
            set
            {
                this.addedBy = value;
            }
        }

        [BelongsTo("CellarId",NotNull = true)]
        public virtual Cellar Cellar
        {
            get
            {
                return this.cellar;
            }
            set
            {
                this.cellar = value;
            }
        }
    }
}
